<script type="application/javascript">

hljs.initHighlightingOnLoad()

var app = new Vue({
  el: '#app',
  data: {
    menuVisible: false,
  },
})

</script>

<% if (typeof commentSetting !== 'undefined' && commentSetting.showComment) { %>

  <% if (commentSetting.commentPlatform === 'gitalk') { %>
    <script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
    <script>

      var gitalk = new Gitalk({
        clientID: '<%= commentSetting.gitalkSetting.clientId %>',
        clientSecret: '<%= commentSetting.gitalkSetting.clientSecret %>',
        repo: '<%= commentSetting.gitalkSetting.repository %>',
        owner: '<%= commentSetting.gitalkSetting.owner %>',
        admin: ['<%= commentSetting.gitalkSetting.owner %>'],
        id: (location.pathname).substring(0, 49),      // Ensure uniqueness and length less than 50
        distractionFreeMode: false  // Facebook-like distraction free mode
      })

      gitalk.render('gitalk-container')

    </script>
  <% } %>

  <% if (commentSetting.commentPlatform === 'disqus') { %>
    <script src="https://unpkg.com/disqusjs@1.1/dist/disqus.js"></script>
    <script>

    var options = {
      shortname: '<%= commentSetting.disqusSetting.shortname %>',
      apikey: '<%= commentSetting.disqusSetting.apikey %>',
    }
    if ('<%= commentSetting.disqusSetting.api %>') {
      options.api = '<%= commentSetting.disqusSetting.api %>'
    }
    var dsqjs = new DisqusJS(options)

    </script>
  <% } %>

<% } %>

